package tij4.ch11;

import java.util.LinkedList;
import java.util.List;

public class LinkedListFeatures
{

	private static void populatePets(List<Pet> coll)
	{
		Pet pet1 = new Pet("pet1"); 
		Pet pet2 = new Pet("pet2"); 
		Pet pet3 = new Pet("pet3"); 
		Pet pet4 = new Pet("pet4"); 
		Pet pet5 = new Pet("pet5"); 
		
		coll.add(pet1);
		coll.add(pet2);
		coll.add(pet3);
		coll.add(pet4);
		coll.add(pet5);
	}
	
	public static void main(String[] args)
	{
		
		LinkedList<Pet> pets = new LinkedList<Pet>();
		populatePets(pets);
		
		System.out.println("pets.getFirst() = " + pets.getFirst());
		System.out.println("pets.getLast() = " + pets.getLast());
		
		System.out.println("pets.peek() = " + pets.peek());
		//System.out.println("pets.peek() = " + pets.p);
		
	}
	
}
